//
//  AppDelegate.swift
//  TODOApp
//
//  Created by chenyh on 2018/5/24.
//  Copyright © 2018年 chenyh. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    class var shared: AppDelegate {
        return UIApplication.shared.delegate as! AppDelegate
    }
    var window: UIWindow?


    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        window = UIWindow(frame: UIScreen.main.bounds)
        window?.backgroundColor = UIColor.white
        
        //这块可以给页面
        if TODOToolManager.CommonTool.isLogin() {
            gotoHome()
        }else {
            gotoLogin()
        }

        
        
        window?.makeKeyAndVisible()
        return true
    }
    
    func gotoHome()  {
        window?.rootViewController = R.storyboard.main().instantiateInitialViewController()
    }
    func gotoLogin()  {
        
        window?.rootViewController = R.storyboard.account().instantiateInitialViewController()
    }
}

